﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Wicresoft.SMS.Data
{
    public interface IAddressWebDataAccess
    {
        //插入一条记录
        int AddAddress(string name, string number, int userId);
        //修改
        bool UpdateAddress(string name, string number, int id);
        //根据用户查找（带分页）
        List<AddressSendInfoModel> GetNumberByUser(int UserId, int index, int max, string key);
        //根据用户查找（不带分页）
        List<AddressSendInfoModel> GetNumberByUsers(int UserId);
        //更加用户查找(不带分页 带组信息)
        List<AddressSendInfoModel> GetNumberWithGroupByUsers(int UserId);
        //搜索
        List<AddressSendInfoModel> GetNumberByText(string text, int UserId);
        //删除
        bool DeleteNumberByAddressId(int addressId, string addnumber);
        //分页
        int GetPageCount(int UserId, int max, string key);

        int CreateNewGroup(int UserID, string name);
        List<AddressGroupInfo> GetGroupsByUserid(int userid);
        List<AddressGroupInfo> GetGroupsByUserid(int userid, int page, int max);
        int GetGroupPageCount(int userid, int max);
        List<AddressSendInfoModel> GetContactsByGroupID(int userid, int groupid);
        int SaveRelations(int userid, int groupid, int[] items);
        int RemoveGroup(int userid, int[] groupids);
        List<AddressExportInfo> GetContactsForExport(int userid);

        int ImportContact(DataTable dt, int userid);
    }
}
